package com.xszx.entity.enums;

public enum AssetEnmu {

    disabled(1,"禁用"),
    leisure(2,"空闲"),
    inservice(3,"使用中"),
    maintains(4,"维修中"),
    scrap(5,"报废");


    private int id;

    private String name;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    AssetEnmu(int id, String name) {
        this.id = id;
        this.name = name;
    }

    //
    public static AssetEnmu getId(String name){
        for (AssetEnmu assetEnmu : AssetEnmu.values()) {
            if(assetEnmu.getName().equals(name)){
                return assetEnmu;
            }
        }
        throw new IllegalArgumentException();
    }

    public static AssetEnmu getName(int id){
        for (AssetEnmu assetEnmu : AssetEnmu.values()) {
            if(assetEnmu.getId()==id){
                return assetEnmu;
            }
        }
        throw new IllegalArgumentException();
    }


}
